import HttpService from "@/api";

/**
 * @description 获取菜单列表
 * @param
 * @returns
 */
export const menuListApi = () => HttpService.get<any>(`/system/menu/list`);

/**
 * @description 新增角色
 * @param param
 * @returns
 */
export const addRoleApi = (userForm: any) => HttpService.post<any>("/system/role", userForm);

/**
 * @description 更新角色
 * @param param
 * @returns
 */
export const updateRoleApi = (userForm: any) => HttpService.put<any>("/system/role", userForm);

/**
 * @description 删除角色
 * @param ids
 * @returns
 */
export const delRoleApi = (ids: string) => HttpService.delete<any>(`/system/role/${ids}`);

/**
 * @description 根据角色id或者角色详细信息
 * @param roleId
 * @returns
 */
export const roleIdApi = (roleId: string) => HttpService.get<any>(`/system/role/${roleId}`);

/**
 * @description 根据角色id获取对应的菜单树形列表
 * @param roleId
 * @returns
 */
export const roleMenuTreeSelectApi = (roleId: string) => HttpService.get<any>(`/system/menu/roleMenuTreeSelect/${roleId}`);

/**
 * @description 获取对应角色部门树列表
 * @param roleId
 * @returns
 */
export const getRoleDeptTreeApi = (roleId: number) => HttpService.get<any>(`/system/role/deptTree/${roleId}`);
